Flchenfllungen nach Escher
defDraw()
====================================

ScriptBegin
var Grafik = "Script Turtle"

var a=10;              // AB 
    b=8*a/10;          // BC 
    w=108;             // Winkel AB,BC
    x0=-290; y0=-100;  // Anfangspunkt
    cRand  ="black";
    cMM    =0.3; 
    cFill  ="lightblue"
    cFillx ="orange"; //"firebrick";
    cFill1 ="orange"
    cFill2 ="gray";//"blue"


function init()
{ t.setGradient(-140,90,140,-90,cFill1,cFill2);
  t.setBrush("",15); 
  t.setPage();  
  t.setAntiAliasing(); 
}


function draw()
{ //t.drawKoordSystem();
  //t.drawRaster();
  t.setBrush("",1);

  defSplines()
  defFliese();
  t.msgDraw();
  //t.goTo(-100,-60); t.turnTo(0); t.draw("Fliese");

  pflaster();
  t.setPen(cRand); t.rahmen();
}



function defSplineAB()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(8,-10);
 t.moveTo(9,3);
 t.moveTo(21,-7);
 t.moveTo(25,-5);
 t.moveTo(17,5);
 t.moveTo(25,10);
 t.moveTo(35,0);
 t.endPolygon(3);
 t.splinePolygon()
} 


function defSplineBC()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(-2,5);
 t.moveTo(10,3);
 t.moveTo(10,9);
 t.moveTo(18,12);
 t.moveTo(7,17);
 t.moveTo(4,12);
 t.moveTo(-1,16);
 t.moveTo(-5,10);
 t.moveTo(-11,17);
 t.moveTo(-5,25);
 t.endPolygon(3);
 t.splinePolygon();
}


function defSplines()
{ t.setPen(cRand,0.2);
  
  t.beginPolygon(); t.setNoStyle();
  t.goTo(0,0);   t.defPoint("A"); 
  t.turnTo(0); t.move(a); t.defPoint("B");
  t.endPolygon(3);
  t.defPoint("ShiftX");
  t.setPen(); t.defDraw("AB");
  defSplineAB(); t.defDraw("AB",3);

  t.beginPolygon(); t.setNoStyle();
  t.goTo("B");
  t.turnTo(w); t.move(b); t.defPoint("C");
  t.endPolygon(3);
  t.defPoint("ShiftY");
  t.setPen(); t.defDraw("BC");
  defSplineBC(); t.defDraw("BC",3);

  //t.goTo(0,0); t.turnTo(0); t.draw("AB"); t.draw("BC");

} 


function  defFliese()
{ t.beginPolygon();
  t.setPolygon("AB",0);
  t.addPolygon("BC",0);
  t.addPolygon("AB",-1);
  t.addPolygon("BC",-1);
  t.endPolygon();
  t.setPen(cRand,cMM);
  t.setBrush(cFill);  
  t.defDraw("Fliese"); 
}



function pflaster()
{
  t.turnTo(0);
  t.setPen(cRand); 
  t.setNoStyle();  t.setBrush(cFillx); 

  for(j=0; j<30; j++)
  { t.goTo(x0,y0);
    t.shift("ShiftY",j);
    //if (j % 2)  t.shift("ShiftY",2);    

    for(i=0; i<21;i++)
    { if ((i==10)||(i==11)||(i==12))
       { t.setPen(); 
         t.draw("Fliese",false);
         t.setPen("",-1,0); 
         t.shift("ShiftX",1);
       }
      else 
       { t.draw("Fliese");
         t.shift("ShiftX",2);
       }   
    }  
  }
}


ScriptEnd
----------------------------------------------
